Here's the code you've already written for this game.

  • Click Run to play the game. Explore the code and make sure you remember how it works.
  • If you customized your game at the end of the last lesson, you can use copy-paste to bring in your own code.

Highlight the text you want and press ctrl + c. Click where you want to put the text, and press ctrl + v.

To navigate the page using the TAB key, first press ESC to exit the code editor.

stage.set_background("schoolhallway") sprite = codesters.Sprite("person10", -125, -100) emma = codesters.Sprite("person8", 0, -125) points = 0 emma.say("Someone took my phone!") stage.wait(3) emma.say("They've been sending people mean texts, and people think I sent them!") stage.wait(3) sprite.say("What should I do?") choice = sprite.ask("a)Tell a trusted adult b)Tell people Tanya is sending the messages c)Ignore Tanya") # text = codesters.Text("text", x, y) text = codesters.Text("Hello up here.", 0, 200) if choice == "a": text.set_text("Great choice!") if choice == "b": text.set_text("It's not very nice to spread rumors!") if choice == "c": text.set_text("Don't be a bystander, stand up to bullying!") emma.move_right(500) # second scenario mike = codesters.Sprite("person12") mike.go_to(0, -125) mike.say("Someone has been harassing me online!") stage.wait(3) mike.say("I think my friend Tom might be doing it.") stage.wait(3) sprite.say("What should I do?") choice = sprite.ask("a)Laugh at Mike b)Sympathize with Mike c)Harass Tom") if choice == "a": text.set_text("Think how that makes Mike feel!") if choice == "b": text.set_text("Great job!") if choice == "c": text.set_text("Don't fight harassment by harassing someone else!")
  • Run Code
  • Submit Work
  • Next Activity
  • Show Console
  • Reset Code Editor
  • Codesters How To (opens in a new tab)